import { ApiProperty } from '@nestjs/swagger';
import { Permission } from '../entities/permission.entity';

class UserInfo {
  @ApiProperty()
  id: number;
  @ApiProperty({ example: 'zhangsan' })
  username: string;
  @ApiProperty({ example: '张三' })
  nickName: string;
  @ApiProperty({ example: 'xxx@xx.com' })
  email: string;
  @ApiProperty({ example: 'https://xxx.com/xxx.jpg' })
  headPic: string;
  @ApiProperty({ example: '13800138000' })
  phoneNumber: string;
  @ApiProperty()
  isFrozen: boolean;
  @ApiProperty()
  isAdmin: boolean;
  @ApiProperty()
  createTime: number;
  @ApiProperty({
    example: ['admin', 'user'],
  })
  roles: string[];
  @ApiProperty()
  permissions: Permission[];
}

export class LoginUserVo {
  @ApiProperty()
  userInfo: UserInfo;
  @ApiProperty()
  accessToken: string;
  @ApiProperty()
  refreshToken: string;
}
